package com.dubbo.product.remote;

import com.alibaba.dubbo.config.annotation.Service;
import com.dubbo.platform.product.contract.IProductService;
import com.dubbo.platform.product.entity.Product;

import java.util.ArrayList;

@Service(version = "1.0.0")
public class ProductServiceImpl implements IProductService {
    public ArrayList<Product> getProductsByTimestamp(int type){
        ArrayList<Product> products = new ArrayList<Product>();
        for(int i = 0; i < 10; i++){
            Product tmp = new Product();
            tmp.setInfoId(1000000L + i);
            tmp.setUid(100L + i);
            tmp.setImages("pic.nx.com/11111.jpg");
            tmp.setTitle("商品标题" + i);
            tmp.setDescribe("商品描述" + i);
            products.add(tmp);
        }
        return products;
    }

    public Product getProductsById(Long infoId){
        Product products = new Product();
        products.setInfoId(1000000L);
        products.setUid(100L);
        products.setImages("pic.nx.com/11111.jpg");
        products.setTitle("商品标题");
        products.setDescribe("商品描述");
        return products;
    }
}

